<?php


if(1){
	header("Content-Type: application/force-download");
	header("Content-Type: application/octet-stream");
	header("Content-Type: application/download");
	header("Content-Transfer-Encoding:utf-8");
	header("Pragma: no-cache");
	header('Content-Type: application/vnd.ms-excel');
	header('Cache-Control: max-age=0');
	header("Content-Disposition:filename=" . "_" . date("Ymd") . time() . ".xls");
}


$titles = array("序號","市調編號","物件編號","物件狀態","售租","所有權人","手機","電話","市調狀態","委托人","手機","電話","案名","大樓名稱","物件用途","物件型式","建物門牌-行政區","建物門牌-地址","區域","建號","售-總價","售-車位","售-房屋售價","售-房屋單價","售-車位售價","售-車位單價","售-土地單價","租-總價","租-車位","租-房屋租金","租-車位租金","租-每坪租金","租-每月車位租金","租-押金-月","租-押金-萬","租-租期最少","租-租期最多","租-租期調漲","租-免租裝潢期","租-附屬配備","租-公證","建物面積","主建物面積","附屬建物面積","公設","總權狀面積-坪","總權狀面積-車位","車位面積-坪","車位面積-個","使用面積","公設比","基地座落-段","基地座落-小段","地號","基地面積","權利范圍1","范圍2","土地持份面積","公告現值","總公告現值-萬","總公告現值-年","土地使用分區","容積率","建蔽率","每月管理費","每坪管理費","管理方式","室內格局-房","室內格局-廳","室內格局-衛","室內格局-套房","落地窗","該戶大門","本棟大門","當層戶數","該棟戶數","總棟數","總戶數","所在樓層","樓層規劃-地上","樓層規則-地下","電梯數-電梯","電梯數-貨梯","面臨路寬","使用狀況","租賃到期日","承租方行業別","樓地板高度","建物外觀","主要建材","建物完成日","屋齡","年租金","投報率","建設公司","建築執照號","帶看方式","鑰匙管理","緯度","經度","幣別","面積單位","銀行設定總金額","貸款銀行","其他設定金額","自備款","預估貸款","環境特色","物件特色","公共設施","消防保全","商圈1","商圈2","公園1","公園2","捷運線1","捷運站1","捷運線2","捷運站2","學區（國小）","學區（國中）","學區（高中）","車位所在樓層","車位號碼","車位入口高度","公設車位-坪","公設車位-個","獨立權狀車位-坪","獨立權狀車位-個","車位管理費","車位總管理費","車位類型","類型個數","車位單價","車位類型1","類型個數1","車位單價1","使用權車位數","抽籤-年","上網","鑑價日期","鑑價機構","鑑價金額","物件案別","附近成交行情","密件","狀態","無效說明","備注","接待人","指派主管","指派日期","指派經紀人");

echo '<table border=1 style="font-size:14px;">';
echo '<tr>';
foreach ($titles as $key => $name) {
	echo '<td>';
	echo $name;
	echo '</td>';
}
echo '</tr>';

$_string='';
$i = 1;
$object_type='';
//print_r($object_querty);



foreach($res as  $val){
	if(1){
			echo '<tr>';
			echo '<td>' . $i . "</td>";

			if($val->market_survey_no){
				
					echo "<td>".$_string.$val->market_survey_no."</td>";		
			}else{
				echo "<td></td>";
			}


			
			if($val->object_no){
				echo "<td>".$_string.$val->object_no."</td>";
			}else{
				echo "<td></td>";
			}
			
			if(isset($object_state[$val->object_state])){ 
				echo "<td>".$object_state[$val->object_state]."</td>";
			}else{
				echo "<td></td>";
			}
			
			
			if($val->type_rent==1) 
				$object_type="租";
			if($val->type_sale==1) 
				$object_type="售";
			if($val->type_help_seal==1) 
				$object_type="代銷";
			
			echo "<td>".$object_type."</td>";
			
			if($val->owner)
				echo "<td>".$_string.$val->owner."</td>";
			else 
				echo "<td></td>";
			
			
			if($val->owner_mobile)
				echo "<td>".$_string.$val->owner_mobile."</td>";
			else 
				echo "<td></td>";
			if($val->owner_phone)
				echo "<td>".$_string.$val->owner_phone."</td>";
			else
				echo "<td></td>";
			if($val->market_research_status>0)
				echo "<td>".$market_state[$val->market_research_status]."</td>";
			else
				echo "<td></td>";
			if($val->principal) 
				echo "<td>".$_string.$val->principal."</td>";
			else
				echo "<td></td>";
			if($val->principal_mobile)
				echo "<td>".$_string.$val->principal_mobile."</td>";
			else
				echo "<td></td>";
			if($val->principal_phone)
				echo "<td>".$_string.$val->principal_phone."</td>";
			else
				echo "<td></td>";	
			if($val->case_name)
				echo '<td>'.$_string.$val->case_name."</td>";			
			else
				echo "<td></td>";
			
			if(isset($building_name[$val->building_name]))
				echo "<td>".$building_name[$val->building_name]."</td>";
			else
				echo "<td></td>";
				
			if(isset($object_usage[$val->object_usage]))
				echo "<td>".$object_usage[$val->object_usage]."</td>";
			else
				echo "<td></td>";
			
			
			if(isset($object_styles[$val->object_styles]))
				echo "<td>".$object_styles[$val->object_styles]."</td>";
			else
				echo "<td></td>";
			
			
			if(isset($administrative_area[$val->administrative_area]))
				echo "<td>".$administrative_area[$val->administrative_area]."</td>";
			else
				echo "<td></td>";
			
			if(isset($administrative_area[$val->administrative_area]))
				echo "<td>".$administrative_area[$val->administrative_area]."</td>";
			else
				echo "<td>物件用途</td>";
			
			
			if($val->area)
				echo "<td>".$val->area."</td>";
			else
				echo "<td></td>";
			
			
			if($val->build_number!=0)
				echo "<td>".(int)$_string.$val->build_number."</td>";
			else
				echo "<td></td>";
			
			if($val->sale_total!=0)
				echo "<td>".$_string.(int)$val->sale_total."</td>";
			else
				echo "<td></td>";
			
			
			if($val->sale_parking!=0)
				echo "<td>".$_string.$val->sale_parking."</td>";
			else
				echo "<td></td>";
			if($val->sale_housing_prices!=0)
				echo "<td>".(int)$val->sale_housing_prices."</td>";
			else
				echo "<td></td>";
			if($val->sale_housing_unit_price!=0)
				echo "<td>".(int)$val->sale_housing_unit_price."</td>";
			else
				echo "<td></td>";
			if($val->sale_parking_price!=0)
				echo "<td>".(int)$val->sale_parking_price."</td>";
			else
				echo "<td></td>";
			if($val->sale_parking_unit_price!=0)
				echo "<td>".(int)$val->sale_parking_unit_price."</td>";
			else
				echo "<td></td>";
			if($val->sale_land_unit_price!=0)
				echo "<td>".(int)$val->sale_land_unit_price."</td>";
			else
				echo "<td></td>";
			if($val->rent_total!=0)
				echo "<td>".(int)$val->rent_total."</td>";
			else
				echo "<td></td>";
			if($val->rent_parking!=0)
				echo "<td>".(int)$val->rent_parking."</td>";
			else
				echo "<td></td>";
			if($val->rent_housing_rent!=0)
				echo "<td>".(int)$val->rent_housing_rent."</td>";
			else
				echo "<td></td>";
			if($val->rent_parking_space_rentals!=0)
				echo "<td>".(int)$val->rent_parking_space_rentals."</td>";
			else
				echo "<td></td>";
			if($val->rent_rent_per_ping!=0)
				echo "<td>".(int)$val->rent_rent_per_ping."</td>";
			else
				echo "<td></td>";
			if($val->rent_monthly_rent_parking_spaces!=0)
				echo "<td>".(int)$val->rent_monthly_rent_parking_spaces."</td>";
			else
				echo "<td></td>";
			
			if($val->rent_deposit_month)
				echo "<td>".(int)$val->rent_deposit_money."萬"."</td>";
			else
				echo "<td></td>";
			
			
			if($val->rent_deposit_month)
				echo "<td>".$_string.$val->rent_deposit_month."月"."</td>";
			else
				echo "<td></td>";
			
			
			
			if($val->rent_min!=0)
				echo "<td>".$_string.$val->rent_min."</td>";
			else
				echo "<td></td>";
			
			
			if($val->rent_max)
				echo "<td>".$_string.$val->rent_max."</td>";
			else
				echo "<td></td>";
			
			
			if($val->rent_lease_hike)
				echo "<td>".$_string.$val->rent_lease_hike."</td>";
			else
				echo "<td></td>";
			
			
			
			if($val->rent_rent_free_period_decoration)
				echo "<td>".$_string.$val->rent_rent_free_period_decoration."</td>";
			else
				echo "<td></td>";
			
			
			if(isset($affiliated_with[$val->rent_ancillary]))
				echo "<td>".$affiliated_with[$val->rent_ancillary]."</td>";
			else
				echo "<td></td>";
			
			if($val->rent_notarization==1)
				echo "<td>"."有"."</td>";
			else
				echo "<td></td>";
			
			if($val->building_area)
				echo "<td>".$_string.$val->building_area."</td>";
			else
				echo "<td></td>";
			
			if($val->main_building_area)
				echo "<td>".$_string.$val->main_building_area."</td>";
			else
				echo "<td></td>";
			if($val->subsidiary_building_area)
				echo "<td>".$_string.$val->subsidiary_building_area."</td>";
			else
				echo "<td></td>";
			if($val->postulate)
				echo "<td>".$_string.$val->postulate."</td>";
			else
				echo "<td></td>";
			if($val->total_weight_shaped_area)
				echo "<td>".$_string.$val->total_weight_shaped_area."</td>";
			else
				echo "<td></td>";
			
			
			if($val->with_parking_number)
				echo "<td>".$_string.$val->with_parking_number."</td>";
			else
				echo "<td></td>";
			
			if($val->parking_area_number)
				echo "<td>".$_string.$val->parking_area_number."</td>";
			else
				echo "<td></td>";
			
			if($val->parking_area_number)
				echo "<td>".$_string.$val->parking_area_number."</td>";
			else
				echo "<td></td>";
			
			
			if($val->use_area!=0)
				echo "<td>".(int)$val->use_area."</td>";
			else
				echo "<td></td>";

			if($val->postulate_than!=0)
				echo "<td>".(int)$val->postulate_than."</td>";
			else
				echo "<td></td>";
			if($val->base_is_located1)
				echo "<td>".$_string.$val->base_is_located1."</td>";
			else
				echo "<td></td>";
			if($val->base_is_located2)
				echo "<td>".$_string.$val->base_is_located2."</td>";
			else
				echo "<td></td>";
			if($val->to_no)
				echo "<td>".$_string.$val->to_no."</td>";
			else
				echo "<td></td>";
				
				
			if($val->base_area!=0)
				echo "<td>".$_string.$val->base_area."</td>";
			else
				echo "<td></td>";
				
				
				
			if($val->scope_of_rights1!=0)
				echo "<td>".$val->scope_of_rights1."</td>";
			else
				echo "<td></td>";
			
			
			
			if($val->scope_of_rights2!=0)
				echo "<td>".$_string.$val->scope_of_rights2."</td>";
			else
				echo "<td></td>";
			
			
			if($val->stakeholders_land_area!=0)
				echo "<td>".(int)$val->stakeholders_land_area."</td>";
			else
				echo "<td></td>";
			
			
			if($val->present_value!=0)
				echo "<td>".(int)$val->present_value."</td>";
			else 
				echo "<td></td>";
				
				
			if($val->total_present_value1!=0) 
				echo "<td>".(int)$val->total_present_value1."</td>";
			else
				echo "<td></td>";
			
			if($val->total_present_value2)
				echo "<td>".$_string.$val->total_present_value2."</td>";
			else
				echo "<td></td>";
			
			
			
			
			if(isset($land_use_zoning[$val->land_use_zoning])) 		
				echo "<td>".$land_use_zoning[$val->land_use_zoning]."</td>";
			else
				echo "<td></td>";
			
			
			
			if($val->volume_rate!=0) 
				echo "<td>".(int)$val->volume_rate."%</td>";
			else
				echo "<td></td>";
			if($val->building_coverage_ratio!=0)
				echo "<td>".(int)$val->building_coverage_ratio."%</td>";
			else
				echo "<td></td>";
			
			
			if($val->monthly_management_fee!=0)
				echo "<td>".(int)$val->monthly_management_fee."</td>";
			else
				echo "<td></td>";
			
			
			if($val->management_fees_per_ping!=0)
				echo "<td>".(int)$val->management_fees_per_ping."</td>";
			else
				echo "<td></td>";
			
			
			if(isset($management[$val->management]))
				echo "<td>".$management[$val->management]."</td>";
			else
				echo "<td></td>";
			if($val->indoor_pattern_house)
				echo "<td>".$_string.$val->indoor_pattern_house."</td>";
			else
				echo "<td></td>";
			if($val->indoor_pattern_hall)
				echo "<td>".$_string.$val->indoor_pattern_hall."</td>";
			else
				echo "<td></td>";
			if($val->indoor_pattern_guard)
				echo "<td>".$_string.$val->indoor_pattern_guard."</td>";
			else
				echo "<td></td>";
			if($val->indoor_pattern_suite)
				echo "<td>".$_string.$val->indoor_pattern_suite."</td>";
			else
				echo "<td></td>";
				
			if(isset($windows[$val->windows])) 
				echo "<td>".$windows[$val->windows]."</td>";
			else
				echo "<td></td>";
			
			
			if(isset($base_is_located[$val->household_door])) 
				echo "<td>".$base_is_located[$val->household_door]."</td>";
			else
				echo "<td></td>";
				
				
			if(isset($base_is_located[$val->building_entrance])) 
				echo "<td>".$base_is_located[$val->building_entrance]."</td>";
			else
				echo "<td></td>";
			
			
			if($val->households)
				echo "<td>".$_string.$val->households."</td>";
			else
				echo "<td></td>";
			
			
			if($val->building_households)
				echo "<td>".$_string.$val->building_households."</td>";
			else
				echo "<td></td>";
			
			if($val->total_towers)
				echo "<td>".$_string.$val->total_towers."</td>";
			else
				echo "<td></td>";
			
			
			
			if($val->total_households)
				echo "<td>".$_string.$val->total_households."</td>";
			else
				echo "<td></td>";
			if($val->floor)
				echo "<td>".$_string.$val->floor."</td>";
			else
				echo "<td></td>";


			if($val->floor_plan1)
				echo "<td>".(int)$val->floor_plan1."</td>";
			else
				echo "<td></td>";
			if($val->floor_plan2)
				echo "<td>".(int)$val->floor_plan2."</td>";
			else
				echo "<td></td>";
			if($val->number_of_lifts1)
				echo "<td>".$_string.$val->number_of_lifts1."</td>";
			else
				echo "<td></td>";
			if($val->number_of_lifts2)
				echo "<td>".$_string.$val->number_of_lifts2."</td>";
			else
				echo "<td></td>";
			if($val->facing_the_lane!=0)
				echo "<td>".(int)$val->facing_the_lane."</td>";
			else
				echo "<td></td>";
			if(isset($use_status[$val->use_status])) 
				echo "<td>".$use_status[$val->use_status]."</td>";
			else
				echo "<td></td>";
			if($val->lease_maturity)
				echo "<td>".$_string.$val->lease_maturity."</td>";
			else
				echo "<td></td>";
			if($val->lessee_by_industry)
				echo "<td>".$_string.$val->lessee_by_industry."</td>";
			else
				echo "<td></td>";



			if($val->floor_height!=0)
				echo "<td>".(int)$val->floor_height."</td>";
			else
				echo "<td></td>";


			//建物外觀
			if(isset($building_exterior[$val->building_exterior]))
				echo "<td>".$building_exterior[$val->building_exterior]."</td>";
			else
				echo "<td>";
				//echo $building_exterior;
				echo "</td>";
			if(isset($main_building[$val->main_building])) 
				echo "<td>".$main_building[$val->main_building]."</td>";
			else
				echo "<td></td>";
			if($val->building_completion_date)
				echo "<td>".$_string.$val->building_completion_date."</td>";
			else
				echo "<td></td>";	
			if($val->year_of_construction)
				echo "<td>".(int)$val->year_of_construction."</td>";
			else
				echo "<td></td>";

			if($val->annual_rent!=0)
				echo "<td>".(int)$val->annual_rent."</td>";
			else
				echo "<td></td>";

			if($val->reported_rate!=0)
				echo "<td>".(int)$val->reported_rate."</td>";
			else
				echo "<td></td>";
			if($val->construction_company!=0)
				echo "<td>".(int)$val->construction_company."</td>";
			else
				echo "<td></td>";
			if($val->construction_license_no!=0)
				echo "<td>".(int)$val->construction_license_no."</td>";
			else
				echo "<td></td>";
			if(isset($look_mode[$val->look_mode])) 
				echo "<td>".$look_mode[$val->look_mode]."</td>";
			else
				echo "<td></td>";
			if($val->key_management)
				echo "<td>".$_string.$val->key_management."</td>";
			else
				echo "<td></td>";
			
			if($val->location_map1)
				echo "<td>".$_string.$val->location_map1."</td>";
			else
				echo "<td></td>";

			if($val->location_map2)
				echo "<td>".$_string.$val->location_map2."</td>";
			else
				echo "<td></td>";
			if(isset($currency[$val->currency])) 
				echo "<td>".$currency[$val->currency]."</td>";
			else
				echo "<td></td>";
			if(isset($area_unit[$val->area_unit])) 
				echo "<td>".$area_unit[$val->area_unit]."</td>";
			else
				echo "<td></td>";

			if($val->bank_set_total_amount!=0)
				echo "<td>".(int)$val->bank_set_total_amount."</td>";
			else
				echo "<td></td>";
			
			if($val->loan_bank!=0)
				echo "<td>".(int)$_string.$val->loan_bank."</td>";
			else
				echo "<td></td>";
			if($val->other_settings_amount)
				echo "<td>".(int)$val->other_settings_amount."</td>";
			else
				echo "<td></td>";

			if($val->bring_own_money!=0)
				echo "<td>".(int)$val->bring_own_money."</td>";
			else
				echo "<td></td>";

			if($val->estimated_loan!=0)
				echo "<td>".(int)$val->estimated_loan."</td>";
			else
				echo "<td></td>";

			if(isset($environmental_features[$val->environmental_features])) 
				echo "<td>".$environmental_features[$val->environmental_features]."</td>";
			else
				echo "<td></td>";
				
				
			if(isset($object_features[$val->object_features])) 
				echo "<td>".$object_features[$val->object_features]."</td>";
			else
				echo "<td></td>";
			
			
			if(!empty($val->public_facilities)){ 
				echo "<td>";
				//echo $val->public_facilities;
				//echo '<br>';
				//print_r($public_facilities);

				foreach($public_facilities as $key => $value){
					if($val->public_facilities == $key){
						echo $value;
					}
				}

				//echo $public_facilities[$object->public_facilities];

				echo "</td>";
			}else{
				echo "<td></td>";
			}

			if(isset($fire_and_security[$val->fire_and_security])) 
				echo "<td>".$fire_and_security[$val->fire_and_security]."</td>";
			else
				echo "<td></td>";

			if($val->circle1)
				echo "<td>".$_string.$val->circle1."</td>";
			else
				echo "<td></td>";
			if($val->circle2)
				echo "<td>".$_string.$val->circle2."</td>";
			else
				echo "<td></td>";
			
			/*
			if($val->park1)
				echo "<td>".$_string.$val->park1."</td>";
			else
				echo "<td></td>";
			*/
			if($val->park1)
				echo "<td>".$_string.$val->park1."</td>";
			else
				echo "<td></td>";
			
			if($val->park2)
				echo "<td>".$_string.$val->park2."</td>";
			else
				echo "<td></td>";
			
			
			if(isset($mrt_line[$val->mrt_line1])) 
				echo "<td>".$mrt_line[$val->mrt_line1]."</td>";
			else
				echo "<td></td>";
			if(isset($mrt[$val->mrt1])) 
				echo "<td>".$mrt[$val->mrt1]."</td>";
			else
				echo "<td></td>";

			if(isset($mrt_line[$val->mrt_line2])) 
				echo "<td>".$mrt_line[$val->mrt_line2]."</td>";
			else
				echo "<td></td>";
			if(isset($mrt[$val->mrt2])) 
				echo "<td>".$mrt[$val->mrt2]."</td>";
			else
				echo "<td></td>";
			

			if($val->school_district_primary!=0)
				echo "<td>".(int)$val->school_district_primary."</td>";
			else
				echo "<td></td>";
			if($val->school_district_high!=0)
				echo "<td>".(int)$val->school_district_high."</td>";
			else
				echo "<td></td>";
			if($val->school_district_senior!=0)
				echo "<td>".(int)$val->school_district_senior."</td>";
			else
				echo "<td></td>";
			if($val->spaces_where_floor!=0)
				echo "<td>".(int)$val->spaces_where_floor."</td>";
			else
				echo "<td></td>";
			if($val->parking_numbers!=0)
				echo "<td>".(int)$val->parking_numbers."</td>";
			else
				echo "<td></td>";
			if($val->parking_entrance_height!=0)
				echo "<td>".(int)$val->parking_entrance_height."</td>";
			else
				echo "<td></td>";
			if($val->public_parking_spaces1!=0)
				echo "<td>".(int)$val->public_parking_spaces1."</td>";
			else
				echo "<td></td>";
			if($val->public_parking_spaces2!=0)
				echo "<td>".(int)$val->public_parking_spaces2."</td>";
			else
				echo "<td></td>";
			if($val->separate_parking1!=0)
				echo "<td>".(int)$val->separate_parking1."</td>";
			else
				echo "<td></td>";
			if($val->separate_parking2!=0)
				echo "<td>".(int)$val->separate_parking2."</td>";
			else
				echo "<td></td>";
			if($val->car_park_management_fee!=0)
				echo "<td>".(int)$val->car_park_management_fee."</td>";
			else
				echo "<td></td>";
			if($val->total_management_fee_parking!=0)
				echo "<td>".(int)$val->total_management_fee_parking."</td>";
			else
				echo "<td></td>";
			if(isset($parking_type[$val->parking_type1])) 
				echo "<td>".$parking_type[$val->parking_type1]."</td>";
			else
				echo "<td></td>";
			if($val->parking_number1!=0)
				echo "<td>".(int)$val->parking_number1."</td>";
			else
				echo "<td></td>";
			if($val->parking_price1!=0)
				echo "<td>".(int)$val->parking_price1."</td>";
			else
				echo "<td></td>";
			
			if(isset($parking_type[$val->parking_type2])) 
				echo "<td>".$parking_type[$val->parking_type2]."</td>";
			else
				echo "<td></td>";
			if($val->parking_number2!=0)
				echo "<td>".(int)$val->parking_number2."</td>";
			else
				echo "<td></td>";
			if($val->parking_price2!=0)
				echo "<td>".(int)$val->parking_price2."</td>";
			else
				echo "<td></td>";
			if($val->use_parking_number!=0)
				echo "<td>".(int)$val->use_parking_number."</td>";
			else
				echo "<td></td>";

			if($val->ballot!=0)
				echo "<td>".$_string.$val->ballot."</td>";
			else
				echo "<td></td>";

			if($val->internet==0) 
				echo "<td>"."否"."</td>"; 
			else if($val->internet==1) 
				echo "<td>"."是"."</td>";
			
			if($val->valuation_date)
				echo "<td>".$_string.$val->valuation_date."</td>";
			else
				echo "<td></td>";
			if($val->appraisal_agencies!=0)
				echo "<td>".(int)$val->appraisal_agencies."</td>";
			else
				echo "<td></td>";
			if($val->valuation_amount!=0)
				echo "<td>".(int)$val->valuation_amount."</td>";
			else
				echo "<td></td>";


			echo '<td>';
			if(!empty($val->object_case_type))
			$e_oct=explode(',', $val->object_case_type);	
			$e_oct_flag=true;

			foreach($e_oct as $__k =>$__v){

				if($e_oct_flag){
					$e_oct_flag=false;
				}else{
					echo '/';
				}

				if($__v==1){
					echo '中古屋';
				}

				if($__v==2){
					echo '預售';
				}

				if($__v==3){
					echo '標售';
				}

			}
			/*
			$oct="";
			if(strstr(
				1))
				$oct="中古屋";
			if(strstr($val->object_case_type,2)){
				if($oct=="")
					$oct="預售";
				else
					$oct="/預售";
			}
			if(strstr($val->object_case_type,3)){
				if($oct=="")
					$oct="標售";
				else
					$oct="/標售";
			}

			*////if($oct)
			//	echo "<td>".$val->oct.$val->object_case_type."</td>";
			//else
				//echo "<td>".$val->object_case_type;
			echo "</td>";
			
			
			
			if($val->transaction_prices_near!=0)
				echo "<td>".(int)$val->transaction_prices_near."</td>";
			else
				echo "<td></td>";

			if($val->invalid_description!=0)
				echo "<td>".(int)$val->invalid_description."</td>";
			else
				echo "<td></td>";

			if($val->status==1)
				echo "<td>"."有效"."</td>";
			else
				echo "<td>"."無效"."</td>";
			
			
			
			if($val->invalid_description)
				echo "<td>".$_string.$val->invalid_description."</td>";
			else
				echo "<td></td>";
			
			
			if($val->remark)
				echo '<td alt="備注" >'.$_string.$val->remark."</td>";
			else
				echo "<td></td>";
			
			
			
			if($val->front_man){
				echo "<td>";
					//$_string.$val->front_man;
				foreach ($users as $key => $value) {
					if($key==$val->front_man){
						echo $value;
					}		
				}

				echo "</td>";
			}else{
				echo "<td></td>";
			}
			
			
			
			if($val->head){

				echo "<td>";

				
				foreach ($users as $key => $value) {
					if($key==$val->head){
						echo $value;
					}		
				}
				
				echo "</td>";

			}else{
				echo "<td></td>";
			}
			
			
			
			if($val->assigned_date)
				echo "<td>".$_string.$val->assigned_date."</td>\n";
			else
				echo "<td></td>";
			
			
			
			if(!empty($val->broker)){
				echo "<td>";



					foreach ($users as $key => $value) {
						if($key==$val->broker){
							echo $value;
						}		
					}
				echo "</td>";
			}else{
				echo "<td></td>";
			}
			//echo "<td>".date("Y/m/d",$val->ctime)."</td>";
				
			echo '</tr>';
			}
	$i++;
}

echo '</table>';
?>